package dao;

import dto.BaseDTO;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 *
 * @author Maicon
 */
public class BaseDAO extends DaoUtil{

    public BaseDAO(){
        super();
    }


    public boolean incluir(BaseDTO base) throws SQLException, ClassNotFoundException {
        PreparedStatement tbBase = getPreparedStatement("INSERT INTO tb_base "
                                                  + "(id_base, ds_base) "
                                                  + "VALUES (? , ?)");

        tbBase.setInt(1, base.getCodigo());
        tbBase.setString(2, base.getDescricao());

        int retorno = tbBase.executeUpdate();
        tbBase.close();


        return retorno > 0;
    }


}
